import os
BASE_PATH = './VOCDetection/VOCdevkit/VOC2012/'

def get_classes():
    """
    得到所有的分类名称
    :return:
    """
    image_main_path = BASE_PATH + 'ImageSets/Main/'
    class_set = set()
    for file in os.listdir(image_main_path):
        if len(file.split('_')) > 1:
            class_set.add(file.split('_')[0])
    return list(class_set)

# Press the green button in the gutter to run the script.
if __name__ == '__main__':
    print(get_classes())